package com.hzyb.shopContent.service.impl;

import javax.annotation.Resource;

import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

import com.hzyb.oldpack.dao.JdbcDao;
import com.hzyb.shopContent.dao.ShopContentDao;
import com.hzyb.shopContent.model.ShopContent;
import com.hzyb.shopContent.service.ShopContentService;

@Service
public class ShopContentServiceImpl implements ShopContentService{

	@Resource
	private ShopContentDao ShopContentDao;



	@Override
	public ShopContent getShopContentById(String contentSid) {
		return ShopContentDao.findOne(contentSid);
	}


	@Override
	public ShopContent getShopContentByCommoditySid(String commoditySid) {
		return ShopContentDao.findFirstByCommoditySid(commoditySid,new Sort(Sort.Direction.DESC,"enterDate"));
	}
	
	

}
